// TF2Stern Tournament Test Driver
//  by Thomas 'nickmame' Roth

#include <sourcemod>

#include "tf2stern/debug.sp"
#include "tf2stern/output.sp"
#include "tf2stern/tournament.sp"

/////////////////////////////////////////////////////////////////////////////
// CONSTANTS
/////////////////////////////////////////////////////////////////////////////
#define PLUGIN_NAME "TF2Stern"
#define PLUGIN_DESC "tournament mode statistics tracker"
#define PLUGIN_AUTH "Garbagio Panzar"
#define PLUGIN_VERS "0.3.0"
#define PLUGIN_URL  "http://code.google.com/p/tf2stern/"

/////////////////////////////////////////////////////////////////////////////
// PLUGIN INFO
/////////////////////////////////////////////////////////////////////////////
public Plugin:myinfo =
{
  name = PLUGIN_NAME,
  description = PLUGIN_DESC,
  author = PLUGIN_AUTH,
  version = PLUGIN_VERS,
  url = PLUGIN_URL
}

/////////////////////////////////////////////////////////////////////////////
// Tournament Test Driver
/////////////////////////////////////////////////////////////////////////////
new Handle:ghTestTimer = INVALID_HANDLE;

public OnPluginStart()
{
  SternDebugInit();
  SternOutputInit();
  SternTournamentInit();
  
  ghTestTimer = CreateTimer(2.0, TestDriver, _, TIMER_REPEAT);
}

public OnPluginEnd()
{
  KillTimer(ghTestTimer);
  ghTestTimer = INVALID_HANDLE;

  SternTournamentClose();
  SternOutputClose();
  SternDebugClose();
}

public Action:TestDriver(Handle:timer)
{
  if( gtsGameState == tsTournament )
  {
    WriteOutput("some amount of data");
  }
  
  return Plugin_Continue;
}
